﻿

using CustAttributeReflection;
using System.Reflection;

//for (int i = 0; i < 10; i++)
//{
//    Console.WriteLine(new Random().Next(1,10));
//    Task.Delay(1000).Wait();
//}

// 获取应用程序的入口程序集
Assembly entryAssembly = Assembly.GetEntryAssembly();
var call = Assembly.GetCallingAssembly();
// 输出程序集的全名
Console.WriteLine("Entry Assembly: " + call.FullName);

Console.ReadKey();
var student = new Student() { Id =1, Address="郑州",Name="张三" };
var fileds = student.GetType().GetProperties();
foreach(var item in  fileds)
{
    var attrs =  item.GetCustomAttributes<CustCompareAttribute>().FirstOrDefault();
    Console.WriteLine(item.Name+"; attribute:"+ attrs?.IsCompare);
}

Console.ReadKey();